const  express=require("express");
const  app=express();
app.get('/',(req,res)=>{
    console.log(req.query,666);
   /*  res.send('请求成功了'); */
    res.send(req.query.echostr);
});
app.post('/',(req,res)=>{
    /* 获取数据  数据流事件监听 */
    // var bufferList=[];
    // req.on("data",function(buffer){
    //     bufferList.push(buffer); 
    //    bufferList+=buffer
    // })
    // req.on("end",function(){
    //      var  buffer=Buffer.concat(bufferList);
    //     console.log(buffer.toString());
    // }) 

     /* 获取数据  数据流事件监听 */
     var bufferList=null;
     req.on("data",function(buffer){
        bufferList+=buffer
     })
     req.on("end",function(){
         console.log(bufferList)
     })
})
app.listen(80,()=>{
    console.log("http://echo.free.idcfengye.com");
})